/*
 * ThreadException.h
 *
 *  Created on: Apr 19, 2013
 *      Author: Lucifer
 */

#ifndef __BFX_THREADEXCEPTION_H__
#define __BFX_THREADEXCEPTION_H__

namespace BFX
{

#define	DEF_EXCEPTION_SIMPLE1(class_name, base_class_name)	\
class class_name : public base_class_name {	\
public:	\
	class_name()	\
		: base_class_name() {}	\
	class_name(const char* pszMsg)	\
		: base_class_name(pszMsg) {}	\
	class_name(const char* pszFile, int nLine, const char* pszFunc)	\
		: base_class_name(pszFile, nLine, pszFunc) {}	\
	class_name(const char* pszMsg, const char* pszFile, int nLine, const char* pszFunc)	\
		: base_class_name(pszMsg, pszFile, nLine, pszFunc) {}	\
	class_name(const class_name& e)	\
		: base_class_name(e) {}	\
	virtual ~class_name() throw() {}	\
	virtual const char* GetExceptionName() const { return #class_name; }	\
};	\

DEF_EXCEPTION_SIMPLE1(ThreadInterruptedException, Exception)
DEF_EXCEPTION_SIMPLE1(ThreadAbortException, Exception)

} /* namespace BFX */
#endif /* __BFX_THREADEXCEPTION_H__ */
